#ifndef CHTTPCLIENT_H
#define CHTTPCLIENT_H


#include "ihttpclient.h"


/**
 * We use libcurl only for NTLM authentication here.
 * Note: https is not supported.
 * Note: NTLM may not work under linux when using system provided libcurl.
 */
class CHttpClient : public IHttpClient
{
public:
    /**
     * Constructor
     * Create the libcurl handle and set default options.
     */
    CHttpClient();
    /**
     * Destructor
     * Destroy the libcurl handle.
     */
    virtual ~CHttpClient();

    bool setProxy(const char *szServer, const int iPort,
        const char *szUser = 0, const char *szPassword = 0, const char* szDomain = 0);

    bool getUrlToMem(const char *szUrl, char *szBuffer);

    bool getUrlToFile(const char *szUrl, const char *szLocalFilePath);

    void release() { delete this; }

private:
    /** The libcurl handle */
    void *m_pCurl;

};


#endif
